package com.legal_documents_backend.controller;
// 处理请求
import com.legal_documents_backend.pojo.Result;
import com.legal_documents_backend.service.CaseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/case")
@Tag(name = "CaseController", description = "法律文书模块")
public class CaseController {
    @Autowired
    private CaseService caseService;

    @GetMapping("/get")
    @Operation(summary = "获取完整文书数据，可按分页获取")
    public Result getCases(
            @RequestParam(value = "pageNum",required = false) Integer pageNum,
            @RequestParam(value = "pageSize",required = false) Integer pageSize
    ){
        return Result.success("获取案件成功",caseService.getCases(pageNum,pageSize));
    }

}
